/**
 * 旅游包车分析
 */
$(function(){
	tourismViolationAna.init();
});
var iFrameName = this.name;
var tourismViolationAna = {
	init: function(){
		var me = this;
		me.infoWindow=null;
		me.entNameList=null;
		me.addressPath=null;
		me.queryType="ent";
		me.queryContent="";
		me.startTime="";
		me.endTime="";
		me.initQueryTime();	
		me.barChart = me.initBarChart();
		me.lineChart = me.initDetailLineChart();
		me.initEvent();
		me.initEnterpriseList();
		me.initVehicleList();
		me.initHashMap;
		me.queryBarChartData();
		me.initDetailsTable();
	},
	//初始化时间选框
    initQueryTime:function(){
    	var me = this;
        var todayDate = new Date();
        var beforeDate = new Date(todayDate-86400000*1); //前一天
	    var yyyy = beforeDate.getFullYear(), mm = (beforeDate.getMonth() + 1).toString(), dd = beforeDate.getDate().toString();
	    if (mm.length == 1) {
	        mm = '0' + mm;
	    }
	    if (dd.length == 1) {
	        dd = '0' + dd;
	    }
	    var day = yyyy + '-' + mm + '-' + dd;
	    me.startTime=day;
		me.endTime=day;
        $("#inputStartDate").val(day);
        $("#inputEndDate").val(day);
      },
	initEvent: function(){
		var me = this;
		//业户和车牌号选择按键
		$("#choseSelect").on('change',function(){
			var chose = $("#choseSelect").val();
			if (chose == "veh") {
				$("#selectEnterprise").hide();	
				$("#selectVehicle").show();
			}else if (chose == "ent") {
				$("#selectVehicle").hide();
				$("#selectEnterprise").show();
			}
			
		});
		$("#choseSelect").select2();
		$("#queryBtn").click(function(){
			var startTime = $("#inputStartDate").val();
			var endTime = $("#inputEndDate").val();
            var sta_date = new Date((startTime).replace(/-/g, "/"));
            var end_date = new Date((endTime).replace(/-/g, "/"));//将字符串转化为时间
            var num = (end_date - sta_date) / (1000 * 3600 * 24);//求出两个时间的时间差，这个是天数
            var days = parseInt(Math.ceil(num));//转化为整天（小于零的话剧不用转了）
            if (end_date.getMonth()-sta_date.getMonth()>1) {
            	global.ajaxLoading.pop("查询时间不能超过一个月",false,2000);
                return;
			}
            if (days > 31) {
                global.ajaxLoading.pop("查询时间不能超过一个月", false, 2000);
                return;
            }
			me.queryType=$("#choseSelect").val();
			me.startTime=startTime;
			me.endTime=endTime;
			if (me.queryType == "ent") {
				me.queryContent=$.trim($("#selectEnterpriseSel").val());
			}else if (me.queryType == "veh") {
				me.queryContent=$.trim($("#selectVehicleSel").val());
			}
	    	me.queryBarChartData();
			$("#resultTable").flexOptions({
	            	url: appCtx +"/report/tourismViolation/getResultTableByEnt.html?time="+ new Date().getTime(),
	            	params: [{
	            		name:"startTime",
	            		value:startTime
	            	},{
	            		name:"endTime",
	            		value:endTime
	            	},{
	            		name:"queryType",
	            		value:me.queryType
	            	},{
	            		name:"queryContent",
	            		value:me.queryContent
	            	}],
	                newp: 1
	            }).flexReload();
    	});
		$("#exportExcel").click(function(){
			me.exportTourismViolationAna();
		});
		//确定按钮事件
 		$("#confirmOK").click(function() {
            $('#confirmModal').modal('hide');
	    	me.onCallBack(mFrameName,mDialogCallback);
        });
 		 		
 		$("#btnSaveOK").click(function() {
 			eval("("+mDialogOkCall+")");
            $('#confirmModal').modal('hide');
            return false;
        });

 		$("#confirmExport").click(function() {
           // $('#exportModal').modal('hide');
	    	me.onCallBack(mFrameName,mDialogCallback);
        });
 		
 		/* 上一步、下一步 模态框 保存按钮 事件 */
 		$("#btnSave").click(function() {
 			eval("("+mDialogSaveCall+")");
            $('#confirmModal').modal('hide');
            return false;
        });
		$('.detail-report').on('click',"img[name='trackPlayBtn']",function(){
			var me =this;
			var vehicle_no_color = $(this).attr('vehicle_no_color');
     		var longitude = $(this).attr('longitude');
     		var latitude = $(this).attr('latitude');
     		var vehicle_no = $(this).attr('vehicle_no');
   			var vehicle_color = $(this).attr('vehicle_color');
   			var gps_time = $(this).attr('gps_time');
   			var time = tourismViolationAna.getFromatTime(gps_time);
   			var address = $(this).attr('address');
     		var map = new AMap.Map('mymap', {
     	        resizeEnable: true,
     	        zoom:14,
     	        center: [longitude, latitude]
     		});
     		var infoWindow = new AMap.InfoWindow({offset: new AMap.Pixel(0, -30)}); 
    		me.infoWindow = infoWindow;
    		marker = new AMap.Marker({
    		    map: map,
    		    position: [longitude,latitude],
    		    icon: appCtx + "resources/images/mapTool/car1.png",
    		    offset: new AMap.Pixel(-15, -10),
    		    autoRotation: true
    		});
    		marker.content = '车牌：'+vehicle_no+'</br>车牌色：'+vehicle_color+'</br>定位时间：'+time+' </br>地点: '+address;
    		infoWindow.setContent(marker.content);
    		infoWindow.open(map, marker.getPosition());
     		//地图信息

     	});
	},
	//初始化柱状图
	initBarChart: function(){
		var me = this;
		//计算显示的柱子数
		var percent = 100;
		option = {
			title:{text:'',x:'center',textStyle:{fontSize:12,fontWeight:400}  },
		    color: ['#3398DB'],
		    tooltip : {
		        trigger: 'axis',
		        show: true,
		        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
		        	show: true,
		            type : 'line'        // 默认为直线，可选为：'line' | 'shadow'
		        },
		        formatter:function(a){
		        	if(a[0].name==''){
		        		return;
		        	}
		        	var relVal = "";
		        	relVal = a[0].name+"</br>"+"异动车辆数："+a[0].value+"辆";
		        	return relVal;
		        }
		    },
		    grid: {
		        left: '40px',
		        top:'40px',
		        right: '10px',
		        bottom:"15%",
		        //containLabel: true
		    },
		    xAxis : [
		        {
		            type : 'category',
		            data : [],
		            name: '',
		            axisTick: {
		                alignWithLabel: true
		            },
		            axisLabel:{
		            	textStyle: {
                            fontSize: 10
                        }
		            }
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value',
		            show: true,    //显示纵轴false-不显示，true-显示
		            min: 0,
			    	minInterval: 1,
		            name: '车辆数/辆',
		            axisLabel:{
		            	textStyle: {
                            fontSize: 10
                        },
                        formatter: function (value, index) {
                        	if (value >= 1 || value == 0) {
                            	if (value%1 === 0) {
                            		return value;
                            	}
                            }
	                        }
		            }
		        }
		    ],
		    series : [
		        {
		            name:'异动车辆数',
		            type:'bar',
		           // barWidth: '40%',
		            barMaxWidth : '60px',
		            data:[],
		        }
		    ],
		    dataZoom: [{
		        type: 'inside',
		        start: 0,
		        end: percent
		    }, {
		        start: 0,
		        end: percent,
		        fillerColor:'#A3E1A3',
		        handleColor:'#83A7D1',
		        showDetail:false
		    }]
		};
        var myChart = echarts.init(document.getElementById('barChart'));
        myChart.setOption(option);
        window.onresize = myChart.resize;
        myChart.on('click', function(param){
        	var queryTime = me.query_time;
        	var entNameList = me.entNameList;
        	var entName = entNameList[param.dataIndex];
        	if (me.queryType = "ent") {
        		me.queryContent = entName;
			}
        	me.queryDetailLineChartData(entName);
        	 $("#resultTable").flexOptions({
            	url: appCtx +"/report/tourismViolation/getResultTableByEnt.html?time="+ new Date().getTime(),
            	params: [{
            		name:"startTime",
            		value:me.startTime
            	},{
            		name:"endTime",
            		value:me.endTime
            	},{
            		name:"queryType",
            		value:me.queryType
            	},{
            		name:"queryContent",
            		value:me.queryContent
            	}],
                newp: 1
            }).flexReload();
        });
        
        return {
        	refash : function(option){
                myChart.setOption(option);
        	},
        	option : option,
        	barChartDom : myChart
        };        
	},
	initDetailLineChart: function(){
		var me = this;
		option = {
			title:{text:'',x:'center',textStyle:{fontSize:12,fontWeight:400}  },
		    color: ['#3398DB'],
		   /* legend: {
                data:['异动报警数'],
                textStyle: {
                    fontSize: 10 // 用 legend.textStyle.fontSize 更改示例大小
                 },
                 itemWidth: 10,
                 itemHeight: 10
            },*/
		    tooltip : {
		        trigger: 'axis',
		        show: true,
		        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
		        	show: true,
		            type : 'line'        // 默认为直线，可选为：'line' | 'shadow'
		        },
		        formatter:function(a){
		        	if(a[0].name==''){
		        		return;
		        	}
		        	var relVal = "";
		        	relVal = a[0].name+"："+a[0].value+"次";
		        	return relVal;
		        }
		    },
		    grid: {
		        left: '40px',
		        top:'40px',
		        right: '3px',
		        bottom:"10%",
//		        containLabel: true
		    },
		    xAxis : [
		        {
		            type : 'category',
		            data : [],
		            name: '时间',
		            axisTick: {
		                alignWithLabel: true
		            },
		            axisLabel:{
		            	textStyle: {
                            fontSize: 10
                        }
		            }
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value',
		            show: true,    //显示纵轴false-不显示，true-显示
		            min: 0,
			    	minInterval: 1,
			    	axisLabel: {
	                      formatter: function (value, index) {
	                    	  if (value >= 1 || value == 0) {
	                            	if (value%1 === 0) {
	                            		return value;
	                            	}
	                            }
	                        }
	                 },
		            name: '异动报警数/次'
		        }
		    ],
		    series : [
		        {
		            name:'异动报警次数',
		            type:'line',
		            data:[],
		        }
		    ]
		};
            var myChart = echarts.init(document.getElementById("detailLineChart"));
            myChart.setOption(option);
            window.onresize = myChart.resize;
            myChart.on('click', function(param){
            });
            return {
            	refash : function(option){
                    myChart.setOption(option);
            	},
            	option : option,
            	lineChartDom : myChart
            };        
	},
	//加载旅游车辆列表
	initVehicleList:function(){
		var me = this;
		
		$("#selectVehicleSel").select2({
	        theme: "default",
	        allowClear: true,
	        placeholder: "全部旅游车辆",
	        ajax:{
	            url:appCtx + "/report/tourismViolation/getVesByRoleAndKind.html?time="+new Date().getTime(),
	            dataType:"json",
	            delay:250,
	            data:function(params){
	                return {
	                    name: params.term,
	                    page: params.page || 1
	                };
	            },
	            cache:true,
	            processResults: function (res, params) {
			    	if(res){
			    		var options = [];
			    		var option = {"id":" ", "text":"全部车辆"};
			    		options.push(option);
	    				$.each(res,function(index,obj) {
	    					var option = {"id":obj.vehicle_no, "text":obj.vehicle_no};
    	                    options.push(option);
	    				});
    	                return {
    	                	results: options,
    	                    pagination: {
    	                        more:false
    	                    }
    	                };
			    	}
	            },
	            escapeMarkup: function (markup) { return markup; },
	            minimumInputLength: 1
	        }
	    });
		
	},
	//加载业户列表
	initEnterpriseList: function(){
		$('#selectEnterpriseSel').select2({
    		theme: "default",
 	        allowClear: true,
 	        placeholder: "全部业户",
 	        ajax:{
 	            url:appCtx + "/report/tourismViolation/getEnterpirseList.html?time="+new Date().getTime(),
 	            dataType:"json",
 	            delay:250,
 	           async : true,
 	            data:function(params){
 	                return {
 	                    name: params.term,
 	                    page: params.page || 1
 	                };
 	            },
 	            cache:true,
 	            processResults: function (res, params) {
 			    	if(res){
 			    		var options = [];
 			    		var option = {"id":" ", "text":"全部业户"};
 			    		options.push(option);
 	    				$.each(res,function(index,obj) {
 	    					var option = {"id":obj.entName, "text":obj.entName};
     	                    options.push(option);
 	    				});
     	                return {
     	                	results: options,
     	                    pagination: {
     	                        more:false
     	                    }
     	                };
 			    	}
 	            },
 	            escapeMarkup: function (markup) { return markup; },
 	            minimumInputLength: 1
 	        }
    	})
		/*var me = this;
		$.ajax({
			type : 'post',
			async : true,
			url : appCtx + "/report/tourismViolation/getEnterpirseList.html?time="+new Date().getTime(),
			dataType : "JSON",
			success : function(data) {
					var selectStry="<option value=''>全部业户</option>";
					$.each(data,function(index,ent){
						selectStry+="<option value='"+ent.entName+"'>"+ent.entName+"</option>";
					});
					$('#selectEnterpriseSel').html(selectStry);		
					$("#selectEnterpriseSel").select2();
					$("#selectEnterpriseSel").change(function(){
					});
				}
		});*/
	
	},

	queryBarChartData: function(){
		var me = this;
		$.ajax({
			type : 'post',
			async : true,
			url : appCtx+"/report/tourismViolation/getBarChartData.html?time="+new Date().getTime(),
			data:{
        		startTime:me.startTime,
        		endTime:me.endTime,
				queryType:me.queryType,
				queryContent:me.queryContent
			},
			dataType : "JSON",
			success : function(data) {
				var option = me.barChart.option;
				option.xAxis[0].data =data.bar_xAxisData; //['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
				option.series[0].data =data.bar_series;// [10, 52, 200, 334, 390, 330, 220];
				me.barChart.refash(option);
				me.entNameList = data.bar_xAxisData;
				me.addressPath = data.address_Path;
				//默认展示第一个的列表
				me.queryDetailLineChartData(data.bar_xAxisData[0]);
			}
		});
	},
	queryDetailLineChartData: function(enterprise_name){
		var me = this;
		$.ajax({
			type : 'post',
			async : true,
			url : appCtx+"/report/tourismViolation/loadDetailLineChartData.html?time="+new Date().getTime(),
			data:{
				enterprise:enterprise_name,
				startTime:me.startTime,
        		endTime:me.endTime
			},
			dataType : "JSON",
			success : function(data) {
				var option = me.lineChart.option;
				option.xAxis[0].data = data.line_xAxisData; //['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
				option.series[0].data = data.line_series;// [10, 52, 200, 334, 390, 330, 220];
				option.title.text = enterprise_name;
				me.lineChart.refash(option);
			}
		});
	},
	/**
	 * 查询分页显示
	 *@Description: 用户单击条形图的某一条,获取条形图的详细列表
	 */
    initDetailsTable: function(){
    	var me = this;
		$("#resultTable").flexigrid({
			url : appCtx + "/report/tourismViolation/getResultTableByEnt.html?time="+ new Date().getTime(),
			dataType : 'json',
			colModel : tourismViolationAna.getColumn(),
			params: [{
				name:"startTime",
        		value:me.startTime
        	},{
        		name:"endTime",
        		value:me.endTime
        	},{
        		name:"queryType",
        		value:me.queryType
        	},{
        		name:"queryContent",
        		value:me.queryContent
        	}],
            contentType: "application/json; charset=utf-8",
            resizable : false,
			minheight: '100px', //列的最小高度
			nowrap: true, //是否不换行
			sortname : "vehicle_no",// 第一次加载数据时排序列
			sortorder : "desc",// 第一次加载数据时排序类型
			usepager : true,// 是否分页，默认为true。
			showToggleBtn : false,
			showTableToggleBtn : true,// 是否显示收起/打开按钮,默认不显示。
			useRp : true,// 是否可以动态设置每页显示的结果数，默认为false。
			rp : 5,// 每页记录数，默认为10
			rpOptions: [5, 10, 20,50, 100], // 每页结果数
			checkbox : false,// 是否要多选框,默认为false。
			rowId : 'id',// 多选框绑定行的id,只有checkbox : true时才有效。
			singleSelect : true,
			widthType:"%",
			width:$('.detail-report').width(),
			height : 310,
			titDisplay: false,
            onSuccess: function (data) {
            	if (data) {
            		$.each(data.rows,function(index,vehicle){
            			var address_Path = tourismViolationAna.addressPath;
            			var longitude = vehicle.coordinates.coordinates[0];
         			    var latitude = vehicle.coordinates.coordinates[1];
	         			var vehicle_no = vehicle.vehicle_no;
	         			var gps_time = vehicle.gps_time;
	         			var vehicle_color = vehicle.vehicle_color_name;
	           			var backId = "#"+vehicle.index+"back";
	           			$(backId).attr('vehicle_no',vehicle_no);
	           			$(backId).attr('vehicle_color',vehicle_color);
	           			$(backId).attr('gps_time',gps_time);
	           			$(backId).attr('longitude',longitude);
	           			$(backId).attr('latitude',latitude);
        			    var id = "#"+vehicle.index;
        		 	    $.ajax({
        		 	         url : address_Path + "?location="+longitude+","+latitude,
        		 	         dataType : 'jsonp',
        		 	         async:false, 
        		 	         success : function(data){
    		 	                if(data.info != "OK") return;
    		 	                var ac = data.regeocodes[0].addressComponent;
    		 	                address = ac.province+ac.city+ac.district+ac.township+ac.streetNumber.street+ac.streetNumber.number;
    		 	                if(address == "") return;
    		 	               $(backId).attr('address',address);
    		 	               $(id).attr('title',address);
    		 	               $(id).html(address);
        		 	          }
        		 	    });
    				});
				}
            },
     	});
    },
	  getFromatTime : function (msg){
	  	  if (null != msg && undefined != msg ) {
		  		var date = new Date(parseInt(msg)); 
	  		    var y = date.getFullYear();    
	  		    var m = date.getMonth() + 1;    
	  		    m = m < 10 ? ('0' + m) : m;    
	  		    var d = date.getDate();    
	  		    d = d < 10 ? ('0' + d) : d;    
	  		    var h = date.getHours();  
	  		    h = h < 10 ? ('0' + h) : h;  
	  		    var minute = date.getMinutes();  
	  		    var second = date.getSeconds();  
	  		    minute = minute < 10 ? ('0' + minute) : minute;    
	  		    second = second < 10 ? ('0' + second) : second;   
	  		  var outTime = y + '-' + m + '-' + d+'  '+h+':'+minute+':'+second;
		  	  	}
		  	  return outTime;
	    },
    getColumn:function(){
    	return [{
            display : '序号',
            name : 'index',
            width : 6,
            sortable : true,
            align : 'left'
        },{
            display : '车牌号',
            name : 'vehicle_no',
            width : 12,
            sortable : false,
            align : 'left',
        },{
            display : '颜色',
            name : 'vehicle_color_name',
            width : 8,
            sortable : false,
            align : 'left',
        },{
            display : '业户',
            name : 'enterprise_name',
            width : 18,
            sortable : false,
            align : 'left',
            showTitle : 'enterprise_name'
        },{
            display : '定位时间',
            name : 'gps_time',
            width : 23,
            sortable : false,
            align : 'left',
            paramcolnames:['gps_time'],
            handlefunction:tourismViolationAna.getFromatTime
        },{
            display : '定位位置',
            name : 'coordinates',
            width : 28,
            sortable : false,
            align : 'left',
            paramcolnames:['index'],
            handlefunction:function(index){
            	var handleStr = "<span style='height:30px;width:180px;' id='"+index+"'></span>";	
        		return handleStr;
            }
        },{
        	display : '操作',
            name : 'Handler',
            width : 20,
            sortable : false,
            align : 'left',
            paramcolnames:['index'],
            handlefunction:function(index){
            var handleStr =  "<a href='JavaScript::'><img name='trackPlayBtn' id='" +index+"back' src='"+appCtx+
            "resources/images/track.png' title='位置定位'></a> ";
		return handleStr;
            }
        }]
    },
    getExColumn :function(){
    	return [{
            display : '序号',
            name : 'index',
            width : 80,
            sortable : true,
            align : 'left'
        },{
            display : '车牌号',
            name : 'vehicle_no',
            width : 100,
            sortable : false,
            align : 'left',
        },{
            display : '颜色',
            name : 'vehicle_color_name',
            width : 80,
            sortable : false,
            align : 'left',
        },{
            display : '业户',
            name : 'enterprise_name',
            width : 300,
            sortable : false,
            align : 'left',
        },{
            display : '定位时间',
            name : 'gps_time',
            width : 150,
            sortable : false,
            align : 'left',
        },{
            display : '定位位置',
            name : 'coordinates',
            width : 300,
            sortable : false,
            align : 'left',
        }]
    },
    exportComfirm:function(){
		var me = this;
		var options = $("#resultTable").getOptions();
		//总记录数
		var total = options.total;
		//开始页数
		var StartPage=$("#StartPageIndex").val();
		//结束页数
		var EndPage=$("#EndPageIndex").val();
		var validate=true;
		var msg="";
		if(!StartPage || StartPage==0){
			msg+="起始页不能为空或者0";
			validate=false;
		}
		if(!EndPage || EndPage==0){
			msg+="结束页不能为空或者0";
			validate=false;
		}
		
		if(StartPage && EndPage &&EndPage<StartPage){
			msg+="结束页要大于起始页";
			validate=false;
		}
		if(!validate){
			me.ajaxLoading(msg,false,2000);
			return;
		}
		$('#exportModal').modal('hide');
		me.ajaxLoading("正在导出,请稍后.....",true,2000);
		//每页大小
		var pagesize = options.rp;
		
		//获取导出的参数
		var exportParams = options.exportParams;
		if((EndPage - StartPage + 1) * pagesize > 60000&&total>60000)
		{
			global.ajaxLoading.pop("最多只能导出60000条数据", true, 2000);
			return
		}
		
        var column = me.getExColumn();
        var exportColumns = new Array();
        for(var i=0;i<column.length;i++){
        	if(column[i].hide!=true){
        		exportColumns.push(column[i]);
        	}
        }
		var header1 = JSON.stringify(exportColumns);
		var colModelList=new Array();//表头
		//图片
		 var imageUrl = me.barChart.barChartDom.getDataURL({
				type: 'png',
			    pixelRatio: 1
		}); 
		 var imageUrl2 = me.lineChart.lineChartDom.getDataURL({
				type: 'png',
			    pixelRatio: 1
		}); 
		var imgsrcList=new Array();
		imgsrcList.push(imageUrl);
		imgsrcList.push(imageUrl2);
		var imgsrc= $.toJSON(imgsrcList);
		
		colModelList.push(header1);
		var colModel= $.toJSON(colModelList);	
		var paramsGrid =  {
				colModel:colModel,
				title:"2点至5点夜间行车表",
        		startTime:me.startTime,
        		endTime:me.endTime,
        		queryType:me.queryType,
        		queryContent:me.queryContent,
				imgsrc:imgsrc,
				StartSize:(StartPage-1)*pagesize,
				pageSize:(EndPage-StartPage+1)*pagesize
		};
		
		post(appCtx + "/report/tourismViolation/exportResultTable.html",paramsGrid);
	},
	/**
	 * 导出业户信息
	 */
	exportTourismViolationAna: function(){
		var me=this;
		var options = $("#resultTable").getOptions();
		var total = options.total;
		if(total==0){
			me.ajaxLoading("无导出数据",false,2000);
			return;
		}
		var pages = options.pages;
		//设置默认的开始结束页
		$("#StartPageIndex").val(1);
		$("#EndPageIndex").val(pages);
		me.doExportModal("导出旅游车辆异动信息",iFrameName,"tourismViolationAna.exportComfirm()");   
	},
	ajaxLoading:function (msg,flag,time){
		global.ajaxLoading.pop(msg,flag,time);
	},

	closeDataDialog:function (){
		 $("#dataModal").modal("hide");
	},

	//confirm
	doConfirm:function (msg,frameName, callback) {
	     mDialogCallback = callback;
	     mFrameName = frameName;
	     $("#confirmInfo").html(msg);
	     $('#confirmModal').modal('show');
	 },
	 
	 //显示导出窗口
	 doExportModal:function (msg,iFrameName,callback){
		      mFrameName = iFrameName;
		      mDialogCallback = callback;
		    $("#exportTitle").html(msg);
			$("#exportModal").modal('show');
			
		},
	 onCallBack:function (mFrameName,mDialogCallback){
			if ("" == mFrameName){
				eval("("+mDialogCallback+")");	
			}else{
				var funStr = "window.frames['"+mFrameName+"']."+mDialogCallback;
				eval("("+funStr+")");	
			}
	 }
 
};
